import Snackbar from "@mui/material/Snackbar";
import { useState } from "react";

const SnackBar = (props: any) => {
  
    const onChange=props.onChange
    const message = props.message;
    const onClose = (event: object, reason: string)=>{
        console.log(reason);
        console.log(event);
    
        onChange()
    }
  return (
    <Snackbar
      anchorOrigin={{ vertical: "bottom", horizontal: "center" }}
      open={props.open}
      message={message}
      autoHideDuration={1500}
      onClose={onClose}
      sx={{width:"100px"}}
    />
  );
};
export default SnackBar;
